package com.pan.admin.quartz.service.impl;

import com.pan.admin.quartz.dao.LowBalanceNoticeDao;
import com.pan.admin.quartz.entity.LowBalanceNoticeVO;
import com.pan.admin.quartz.http.FeiShuHttpSend;
import com.pan.admin.quartz.service.LowBalanceNoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 李源聪
 */
@Service
public class LowBalanceNoticeServiceImpl implements LowBalanceNoticeService {

    @Autowired
    private LowBalanceNoticeDao lowBalanceNoticeDao;
    @Autowired
    private FeiShuHttpSend feiShuHttpSend;

    @Override
    @Profile({"!prod-local"})
    public void lowBalanceNotice() {
        List<LowBalanceNoticeVO> lowBalanceNoticeList = lowBalanceNoticeDao.listLowBalanceNotice();
        feiShuHttpSend.feiShuChatBotNotice(lowBalanceNoticeList);
    }
}
